

#ifndef _SYSTEMBAR_H_
#define _SYSTEMBAR_H_

#include "WidgetsApi.hpp"
#include "../OLCore/AbstractToolBar.hpp"
#include <QLabel>
#include <QAction>
#include <QToolBar>
#include <QTimer>
#include <QToolButton>

namespace NSWidgets {

	class WIDGETSAPI SystemBar :
		public NSCore::AbstractToolBar
{
		Q_OBJECT

	public:
		SystemBar(QWidget* w = nullptr);
		~SystemBar();

	public: /*override*/
		virtual inline QString className() override { return "SystemBar"; };

	public:
		void setMousePostion(int x, int y);
		void setRenderedCount(int count);

	private:
		QString getMemoryTotal();
		qint64 getMemoryUsage();
		QString format(qint64 bytes);

	private slots:
		void updateMemoryUsageSlot();

	private:
		QLabel* m_memory;
		QLabel* m_postion;
		QLabel* m_render_count;
		QToolButton* m_ico_render_count;
		QToolButton* m_ico_memory;
		QToolButton* m_ico_postion;
		QTimer* m_memory_timer;

	};

}

#endif

